<template>
  <div class="mybox">
    <div class="topbox">
      <div class="topdiv">
        <div class="leftbox">
          <div class="leftbg"></div>
          <div class="righttext">
            <div class="toptitle">走出去招商</div>
            <div class="topbg">
              <div class="topvalue">222</div>
              <div class="topunit">批次</div>
            </div>
          </div>
        </div>
      </div>
      <div class="topdiv">
        <div class="leftbox">
          <div class="leftbg bg"></div>
          <div class="righttext">
            <div class="toptitle">接待商客</div>
            <div class="topbg">
              <div class="topvalue">222</div>
              <div class="topunit">批次</div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div class="btmall">
      <div class="btmbg"></div>
      <div class="btmdiv">
        <div class="rouseline">
          <p>新签约正式合同项目</p>
          <div><span style="color: #ffde00;font-weight: 700;font-size: 16px;">120</span>个</div>
        </div>
        <div class="rouseline">
          <p>签约金额<span style="color: #16FDF5;font-weight: 700;font-size: 16px;">102</span>亿元</p>
          <!-- <div class="btmvalues">同比 <div class="topunit box" :class="[checkSigns(222)]"></div>
          </div>
          <div class="topvalue btmvalue" :class="[checkSign(222)]">222%</div> -->
        </div>
      </div>
    </div>
    <div class="btmall">
      <div class="btmbg btmbg1"></div>
      <div class="btmdiv">
        <div class="rouseline">
          <p>在建招商项目</p>
          <div><span style="color: #ffde00;font-weight: 700;font-size: 16px;">120</span>个</div>
        </div>
        <div class="rouseline">
          <p>到位资金<span style="color: #16FDF5;font-weight: 700;font-size: 16px;">102</span>亿元</p>
          <div class="btmvalues">
            <div class="topunit box" :class="[checkSigns(222)]"></div>
            <div class="topvalue btmvalue" :class="[checkSign(222)]">222%</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: '',
  data () {
    return {}
  },
  methods: {
    checkSigns (numStr) {
      const num = parseFloat(numStr)
      return num >= 0 ? 'red' : 'green'
    },
    checkSign (numStr) {
      const num = parseFloat(numStr)
      return num >= 0 ? 'pos' : 'neg'
    }
  }
}
</script>
<style lang="scss" scoped>
.mybox {
  padding: 10px 20px !important;
  white-space: nowrap;

  .topbox {
    display: flex;
    justify-content: space-between;

    .topdiv {
      width: 200px;
      height: 77px;
      background: rgba(43, 101, 156, 0.3);
      border: 1px solid #2B659C;

      .leftbox {
        display: flex;
        justify-content: space-around;
        padding-top: 5px;
        padding-right: 5px;


        .leftbg {
          width: 113px;
          height: 62px;
          background: url('./img/11.png')no-repeat center center;
        }

        .bg {
          background: url('./img/22.png')no-repeat center center;
        }

        .righttext {
          .toptitle {
            font-family: MicrosoftYaHeiUI;
            font-size: 16px;
            color: #FFFFFF;
            text-align: center;
          }

          .topbg {
            display: flex;
            padding-top: 10px;

            .topvalue {
              font-family: YouSheBiaoTiHei;
              font-size: 24px;
              color: #16fdf5;
              text-align: center;
            }

            .btmvalue {
              font-family: Source Han Sans CN;
              font-weight: bold;
              font-size: 24px;
              margin-top: 5px;

              &.pos {
                color: #FE3D3D;
              }

              &.neg {
                color: #03f842;
              }
            }

            .topunit {
              margin-top: 5px;
              font-family: MicrosoftYaHeiUI;
              font-size: 14px;
              color: #FFFFFF;
              text-align: center;
              font-style: normal;
            }

            .box {
              width: 10px;
              height: 16px;
              margin: 0 auto;
              margin-top: 10px;

              &.red {
                background: url('./img/bgc.png')no-repeat center center;
                background-size: 100% 100%;
              }

              &.green {
                background: url('./img/bgc1.png')no-repeat center center;
                background-size: 100% 100%;
              }
            }
          }
        }

      }
    }


  }

  .btmall {
    width: 100%;
    display: flex;
    justify-content: space-between;
    height: 77px;
    background: rgba(43, 101, 156, 0.3);
    border: 1px solid #2B659C;
    padding-top: 10px;
    margin-top: 5px;

    .btmbg {
      width: 122px;
      height: 62px;
      background: url('./img/33.png')no-repeat center center;
    }

    .btmbg1 {
      background: url('./img/44.png')no-repeat center center;
    }

    .btmdiv {
      width: 392px;
      height: 54px;
      // background: url('./img/14.png')no-repeat center center;
      margin: 0 auto;
      padding-top: 5px;

      .rouseline {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 20px;
        box-sizing: border-box;

        p {
          width: 64%;
          text-align: left;
          font-family: MicrosoftYaHeiUI;
          font-size: 14px;
          color: #FFFFFF;
          line-height: 22px;
        }

        div {
          text-align: left;
          font-family: MicrosoftYaHeiUI;
          font-size: 14px;
          color: #FFFFFF;
          line-height: 22px;
        }

        .btmvalue {
          font-family: Source Han Sans CN;
          font-weight: bold;
          font-size: 16px;
          margin-top: 5px;

          &.pos {
            color: #FE3D3D;
          }

          &.neg {
            color: #03f842;
          }
        }

        .btmvalues {
          display: flex;

          .box {
            width: 10px;
            height: 16px;
            margin: 0 auto;
            margin-right: 5px;
            margin-top: 8px;

            &.red {
              background: url('./img/bgc.png')no-repeat center center;
              background-size: 100% 100%;
            }

            &.green {
              background: url('./img/bgc1.png')no-repeat center center;
              background-size: 100% 100%;
            }
          }
        }
      }
    }
  }

}
</style>
